<template>
  <div class="p-20 bg-slate-50">
    <f-icon-picker v-model:value="checked"></f-icon-picker>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { getCachedSystemIcons } from '../../packages/service/fileService/index';

const columns = ref([{ label: '图标1', field: 'url', type: 'image' }]);
const checked = ref('');
const go = ref();
setTimeout(() => {
  go.value.refresh();
}, 3000);
const query = () => {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve({
        data: [
          {
            id: '1805937833226805248',
            url: 'upload/20240626/b65d4fead527466fb4d8316d6407f858.png',
            fileType: {
              code: 'IMAGE',
              desc: '图片'
            },
            suffix: 'png',
            sourceName: 'icon_首页',
            bizType: {
              code: '2',
              desc: '菜单图标'
            },
            createTime: '2024-06-26 20:15:06'
          },
          {
            id: '1805937833230999552',
            url: 'upload/20240626/9b49bee719c3449ba2c89472424670a5.png',
            fileType: {
              code: 'IMAGE',
              desc: '图片'
            },
            suffix: 'png',
            sourceName: 'icon_更多',
            bizType: {
              code: '2',
              desc: '菜单图标'
            },
            createTime: '2024-06-26 20:15:06'
          },
          {
            id: '1805937833222610944',
            url: 'upload/20240626/c9cb4c8c345e4cc1847af3fddd045853.png',
            fileType: {
              code: 'IMAGE',
              desc: '图片'
            },
            suffix: 'png',
            sourceName: 'icon_消息',
            bizType: {
              code: '2',
              desc: '菜单图标'
            },
            createTime: '2024-06-26 20:15:06'
          }
        ]
      });
    }, 1000);
  });
};
async function get() {
  const res = await Promise.all([
    getCachedSystemIcons(),
    getCachedSystemIcons(),
    getCachedSystemIcons(),
    getCachedSystemIcons(),
    getCachedSystemIcons(),
    getCachedSystemIcons()
  ]);
  console.log('res:', res);
}
get();
</script>
